using Sponsorship.ReadModel;
using StructureMap.Configuration.DSL;

namespace Sponsorship.Infrastructure.BootStrapping.Registries
{
    /// <summary>
    /// Registers all instances of <see cref="IReadRepository"/> found in the assembly defining <see cref="IReadRepository"/> (Sponsorship.ReadModel)
    /// with StructureMap.
    /// </summary>
    public class ReadRepositoryRegistry : Registry
    {
        public ReadRepositoryRegistry()
        {
            Scan(x =>
                     {
                         x.Assembly(typeof(IReadRepository).Assembly);
                         x.AddAllTypesOf<IReadRepository>();
                     });
        }
    }
}